<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ title }}</title>
</head>
<body>
<h3>{{ title }}</h3>
<form action="{% url 'result' %}" method="post">
    {% csrf_token %}

    {% if form.errors %}
        <div style="color: red;">
            {% for field in form %}
                {% if field.errors %}
                    <p>{{ field.label }}: {{ field.errors.0 }}</p>
                {% endif %}
            {% endfor %}
        </div>
    {% endif %}

    {{ form.as_p }}
    <input type="submit" value="确定">
</form>
</body>
</html>